package com.tyk.bookstore.back.payment.model.query;

import com.tyk.bookstore.back.common.core.model.type.PaymentWay;
import com.tyk.bookstore.back.payment.model.constant.PaymentRecordValidateConstant;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
 * @author tyk
 * @description 支付记录
 */
@Data
@Schema(name = "PaymentRecordAddQuery", description = "支付记录")
public class PaymentRecordAddQuery implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "支付流水号")
    @NotBlank
    @Size(min = PaymentRecordValidateConstant.TRADE_NO_MIN_LENGTH, max = PaymentRecordValidateConstant.TRADE_NO_MAX_LENGTH)
    @Pattern(regexp = PaymentRecordValidateConstant.TRADE_NO_REGEXP)
    private String tradeNo;

    @Schema(description = "订单ID")
    @NotNull
    @Min(value = 1)
    private Long orderId;

    @Schema(description = "支付金额")
    @NotNull
    @Min(value = 0)
    private BigDecimal amount;

    @Schema(description = "会员ID")
    @NotNull
    @Min(value = 1)
    private Long memberId;

    @Schema(description = "第三方流水号")
    @NotBlank
    @Size(min = PaymentRecordValidateConstant.OUT_TRADE_NO_MIN_LENGTH, max = PaymentRecordValidateConstant.OUT_TRADE_NO_MAX_LENGTH)
    @Pattern(regexp = PaymentRecordValidateConstant.OUT_TRADE_NO_REGEXP)
    private String outTradeNo;

    @Schema(description = "支付方式")
    @NotNull
    private PaymentWay paymentWay;

    @Schema(description = "支付时间")
    @NotNull
    @Future
    private LocalDateTime paymentTime;

}
